local liegong = fk.CreateSkill {

  name = "joyex__liegong",

  tags = {  },

}



liegong:addEffect(fk.TargetSpecified, {
  name = "joyex__liegong",
  anim_type = "offensive",
  events = {fk.TargetSpecified},
  can_trigger = function(self, event, target, player, data)
    if not (target == player and player:hasSkill(liegong.name)) then return end
    local to = player.room:getPlayerById(data.to)
    return data.card.trueName == "slash" and (#to:getCardIds(Player.Hand) <= #player:getCardIds(Player.Hand) or to.hp >= player.hp)
  end,
  on_use = function(self, event, target, player, data)
    local to = player.room:getPlayerById(data.to)
    if #to:getCardIds(Player.Hand) <= #player:getCardIds(Player.Hand) then
      data.disresponsive = true 
    end
    if to.hp >= player.hp then
      data.additionalDamage = (data.additionalDamage or 0) + 1
    end
  end,
})

liegong:addEffect("targetmod", {
  name = "#joyex__liegong_target",
  mute = true,
  bypass_distances = function(self, player, skill, scope)
    return player:hasSkill(liegong.name) and skill.trueName == "slash_skill" 
  end,
})

return liegong